package com.marvin.core;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author yinyin
 * @create 2021/11/15 下午 3:30
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("kss_blog")
public class Blog {
    @TableId(type = IdType.AUTO)
    private Integer id;
    //标题
    private  String title;
    //内容
    private  String content;
    //分类id
    private Integer categoryId;
    //分类名称
    private String categoryTitle;
    //md
    private String htmlContent;
    // 描述
    private String description;
    //封面
    private String img;
    //用户
    private Integer userId;
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    //发布状态
    private Integer status;
    // 删除状态 0未删除 1删除
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;

    public Blog(Integer id, String title, LocalDateTime createTime) {
        this.id = id;
        this.title = title;
        this.createTime = createTime;
    }
}
